<?php

include _ITSTOCK_INCLUDE_DIR_.'html_form.inc.php';

itstock_structure($structure, 'building');
$edit = false;

if(isset($_POST['id'])){
    $structure['where'][0] = sprintf("`%s`.`id`='%s'", $structure['table'], itstock_decode($_POST['id']));
    $edit = itstock_search_all($structure);
}

echo '<b>'.(!$edit?'New ':'').'Building</b><br><br><br><p class="error" id="e_msg" style="display: none;"></p>';
itstock_html_form_open($structure['type'], ($edit?itstock_encode($structure['data'][0]['id']):''));
itstock_html_form_input_text('Building:', 'building' ,($edit?$structure['data'][0]['building']:''), 'Building', 'autofocus required');
itstock_html_form_close();
?>
